#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
    int n, m, a, b, c = 0;
    scanf("%d %d", &n, &m);
    for (a = 1; a <= n; a++)
    {
        for (b = 2; b <= m; b++)
        {
            if (a % b == 0)
            {
                c += 1;
            }
        }
        if (c % 2 == 0)
        {
            if (a == 1)
            {
                printf("%d", a);
            }
            else
            {
                printf(",%d", a);
            }
        }
        c = 0;
    }
    return 0;
}